package com.appkubes.mall.core.pojo;

import com.appkubes.mall.core.po.MallUserAccountHistory;
import com.appkubes.mall.core.po.MallUserAccountHistoryExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface MallUserAccountHistoryMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account_history
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallUserAccountHistorySqlProvider.class, method="countByExample")
    long countByExample(MallUserAccountHistoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account_history
     *
     * @mbg.generated
     */
    @DeleteProvider(type=MallUserAccountHistorySqlProvider.class, method="deleteByExample")
    int deleteByExample(MallUserAccountHistoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account_history
     *
     * @mbg.generated
     */
    @Delete({
        "delete from mall_user_account_history",
        "where account_source_key = #{accountSourceKey,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String accountSourceKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account_history
     *
     * @mbg.generated
     */
    @Insert({
        "insert into mall_user_account_history (account_source_key, app_key, ",
        "user_key, brokerage, ",
        "source_type, source_key, ",
        "source_time, source_status, ",
        "flex_type, flex_segment1, ",
        "flex_segment2, flex_segment3, ",
        "create_time, `state`, ",
        "version)",
        "values (#{accountSourceKey,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, ",
        "#{userKey,jdbcType=VARCHAR}, #{brokerage,jdbcType=DECIMAL}, ",
        "#{sourceType,jdbcType=VARCHAR}, #{sourceKey,jdbcType=VARCHAR}, ",
        "#{sourceTime,jdbcType=TIMESTAMP}, #{sourceStatus,jdbcType=VARCHAR}, ",
        "#{flexType,jdbcType=VARCHAR}, #{flexSegment1,jdbcType=VARCHAR}, ",
        "#{flexSegment2,jdbcType=VARCHAR}, #{flexSegment3,jdbcType=VARCHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{state,jdbcType=VARCHAR}, ",
        "#{version,jdbcType=INTEGER})"
    })
    int insert(MallUserAccountHistory record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account_history
     *
     * @mbg.generated
     */
    @InsertProvider(type=MallUserAccountHistorySqlProvider.class, method="insertSelective")
    int insertSelective(MallUserAccountHistory record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account_history
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallUserAccountHistorySqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="account_source_key", property="accountSourceKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="brokerage", property="brokerage", jdbcType=JdbcType.DECIMAL),
        @Result(column="source_type", property="sourceType", jdbcType=JdbcType.VARCHAR),
        @Result(column="source_key", property="sourceKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="source_time", property="sourceTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="source_status", property="sourceStatus", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_type", property="flexType", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_segment1", property="flexSegment1", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_segment2", property="flexSegment2", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_segment3", property="flexSegment3", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="state", property="state", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallUserAccountHistory> selectByExampleWithRowbounds(MallUserAccountHistoryExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account_history
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallUserAccountHistorySqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="account_source_key", property="accountSourceKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="brokerage", property="brokerage", jdbcType=JdbcType.DECIMAL),
        @Result(column="source_type", property="sourceType", jdbcType=JdbcType.VARCHAR),
        @Result(column="source_key", property="sourceKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="source_time", property="sourceTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="source_status", property="sourceStatus", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_type", property="flexType", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_segment1", property="flexSegment1", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_segment2", property="flexSegment2", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_segment3", property="flexSegment3", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="state", property="state", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallUserAccountHistory> selectByExample(MallUserAccountHistoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account_history
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "account_source_key, app_key, user_key, brokerage, source_type, source_key, source_time, ",
        "source_status, flex_type, flex_segment1, flex_segment2, flex_segment3, create_time, ",
        "`state`, version",
        "from mall_user_account_history",
        "where account_source_key = #{accountSourceKey,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="account_source_key", property="accountSourceKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="brokerage", property="brokerage", jdbcType=JdbcType.DECIMAL),
        @Result(column="source_type", property="sourceType", jdbcType=JdbcType.VARCHAR),
        @Result(column="source_key", property="sourceKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="source_time", property="sourceTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="source_status", property="sourceStatus", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_type", property="flexType", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_segment1", property="flexSegment1", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_segment2", property="flexSegment2", jdbcType=JdbcType.VARCHAR),
        @Result(column="flex_segment3", property="flexSegment3", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="state", property="state", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    MallUserAccountHistory selectByPrimaryKey(String accountSourceKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account_history
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallUserAccountHistorySqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MallUserAccountHistory record, @Param("example") MallUserAccountHistoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account_history
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallUserAccountHistorySqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MallUserAccountHistory record, @Param("example") MallUserAccountHistoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account_history
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallUserAccountHistorySqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MallUserAccountHistory record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account_history
     *
     * @mbg.generated
     */
    @Update({
        "update mall_user_account_history",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "user_key = #{userKey,jdbcType=VARCHAR},",
          "brokerage = #{brokerage,jdbcType=DECIMAL},",
          "source_type = #{sourceType,jdbcType=VARCHAR},",
          "source_key = #{sourceKey,jdbcType=VARCHAR},",
          "source_time = #{sourceTime,jdbcType=TIMESTAMP},",
          "source_status = #{sourceStatus,jdbcType=VARCHAR},",
          "flex_type = #{flexType,jdbcType=VARCHAR},",
          "flex_segment1 = #{flexSegment1,jdbcType=VARCHAR},",
          "flex_segment2 = #{flexSegment2,jdbcType=VARCHAR},",
          "flex_segment3 = #{flexSegment3,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "`state` = #{state,jdbcType=VARCHAR},",
          "version = #{version,jdbcType=INTEGER}",
        "where account_source_key = #{accountSourceKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MallUserAccountHistory record);
}